The present invention relates to an image encoding method and apparatus for encoding image data by reversible (lossless) coding.
Conventionally, there are several known lossless image encoding methods, such as the Markov model coding and the predictive coding. Among the lossless image encoding methods, in the Markov model coding, a pixel to be coded whose luminance is determined on the basis of the states of m neighboring pixels (reference pixels) around the pixel to be coded is regarded as a model of m Markov information sources, and the pixel to be coded is encoded by using different entropy coding methods (e.g., Huffman coding, arithmetic codings) in accordance with the states of its m neighboring pixels. According to this Markov model coding method, high encoding efficiency is expected.
Further, in the predictive coding, a pixel value of a pixel to be coded is predicted on the basis of the neighboring pixels around the pixel to be coded, and the difference between the predicted pixel value and the actual pixel value is encoded by entropy coding. This predictive coding is featured by relative simplicity in encoding processes.
In the aforesaid Markov model coding, it is necessary to generate a Markov table including occurrence probability of symbols in each state of the neighboring pixels. Therefore, when the Markov model coding is applied to an image expressed in many tones, the size of the Markov table causes a problem. For example, when the Markov model coding which refers to n neighboring pixels is applied to image data expressed in 256 tones, then the number of possible states is 256 to the n-th power. The number n of the reference pixels should be increased in order to lower entropy, however, since the number of possible states increases as a geometric progression, it becomes very difficult to lower the entropy in the Markov coding. Therefore, the number of states are generally decreased by regarding states in which the occurrence numbers of symbols are low as a single state or by regarding states in which occurrence probability distributions of symbols resemble each other as a single state, for example. However, complicated processes are necessary for doing so.
In contrast, in predictive coding, the encoding processing is simple, however, there is a drawback in that high encoding efficiency is not expected.